package com.clp.protocol.core.client;

import lombok.Getter;

import javax.annotation.Nullable;
import java.util.Objects;

/**
 * 客户端 事件
 */
@Getter
public abstract class ClientEvent<C> {
    protected C source; // 事件源
    @Nullable
    protected Throwable cause; // 原因

    protected ClientEvent(C source) {
        this(source, null);
    }

    protected ClientEvent(C source, @Nullable Throwable cause) {
        Objects.requireNonNull(source, "Client event source can not be null!");
        this.source = source;
        this.cause = cause;
    }
}
